Skip to content

Restore include_examples parameter to DagBag for backwards compatibility#70399

Closed
bramhanandlingala wants to merge 1 commit into
apache:mainfrom
bramhanandlingala:fix/70283
Closed

Restore include_examples parameter to DagBag for backwards compatibility#70399
bramhanandlingala wants to merge 1 commit into
apache:mainfrom
bramhanandlingala:fix/70283

Conversation

@bramhanandlingala

Copy link
Copy Markdown
Contributor

Summary

include_examples was silently removed from DagBag.__init__ and DagBag.collect_dags() in a minor version bump (3.1.8 -> 3.3.0), breaking any code that constructs DagBag directly with this argument — a common pattern in custom scripts and DAG validation tests — with a TypeError: __init__() got an unexpected keyword argument 'include_examples'. This wasn't mentioned in the 3.3.0 release notes and violates semver expectations for a minor release.

Root Cause

Example DAGs are now loaded via the DAG bundle system (DagBundlesManager) instead of DagBag scanning airflow.example_dags directly. That architectural change is reasonable on its own, but the include_examples parameter was removed outright instead of being deprecated, so any caller passing it — whether True or False — hits a hard crash instead of a warning.

Fix

Restores include_examples to DagBag.__init__ and DagBag.collect_dags(), along with BundleDagBag's guard against include_examples=True. When the parameter is omitted (the common case), behavior is unchanged and no warning is emitted. When passed explicitly, it still works as it did pre-3.3.0 but now emits a DeprecationWarning pointing callers to the new DAG bundle system instead of crashing. Added TestDagBagIncludeExamples in test_dagbag.py covering the omitted, explicit-True, explicit-False, and BundleDagBag cases.

Fixes #70283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing include_examples from DagBag

1 participant